#include "widget.h"
#include "ui_widget.h"
#include<QDebug>
Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
}

Widget::~Widget()
{
    delete ui;
}




void Widget::on_pushButton_up_clicked()
{
    QRect rect = ui->index->geometry();
    qDebug()<<rect;
//    rect.setY(rect.y()-10);
//    ui->index->setGeometry(rect);
    ui->index->setGeometry(rect.x(),rect.y()-10,rect.width(),rect.height());
}

void Widget::on_pushButton_down_clicked()
{
    QRect rect = ui->index->geometry();
    qDebug()<<rect;
//    rect.setY(rect.y()+10);
//    ui->index->setGeometry(rect);
    ui->index->setGeometry(rect.x(),rect.y()+10,rect.width(),rect.height());
}

void Widget::on_pushButton_left_clicked()
{
    QRect rect = ui->index->geometry();
    qDebug()<<rect;
//    rect.setX(rect.x()-10);
//    ui->index->setGeometry(rect);
    ui->index->setGeometry(rect.x()-10,rect.y(),rect.width(),rect.height());
}

void Widget::on_pushButton_right_clicked()
{
    QRect rect = ui->index->geometry();
    qDebug()<<rect;
//    rect.setX(rect.x()+10);
//    ui->index->setGeometry(rect);
    ui->index->setGeometry(rect.x()+10,rect.y(),rect.width(),rect.height());
}
